package com.yunmang.http;

import android.content.Context;

import rx.Subscriber;

/**
 * 封装回调接口类，让子类去处理相应的逻辑代码编写
 * Created by ltt on 2017/3/23.
 */
public abstract class CommonSubscriber<T> extends Subscriber<T>{

    private Context context;

    public CommonSubscriber(Context context){
        this.context = context;
    }
    @Override
    public void onCompleted() {

    }

    @Override
    public void onError(Throwable e) {

    }

    @Override
    public void onNext(T t) {
        requestSuccess(t);
    }

    /**
     * 让子类去实现该方法
     * @param t
     */
    public abstract void requestSuccess(T t) ;


}
